//封装ajax
import axios from 'axios'

let ajax = (url,data,type="GET")=>{
	let promise = null;
	const leixing = type.toUpperCase();
	if(leixing == 'GET'){
		let a = data?{...data,like:Date.now()}:{like:Date.now()};
		promise = axios.get(url,{params:a});
	}else if(leixing == 'POST'){
		promise = axios.post(url,data)
	}
	return promise
}
export default ajax


